#!/usr/bin/env.python
# _*_ coding:utf-8 _*_
# # # # # # # # # # # # # # # # # # # #
#  题目:   request_response的urls      #
#  姓名:         李吉辉                #
#  时间:    2018年12月9日20:34:43      #
# # # # # # # # # # # # # # # # # # # #

from django.conf.urls import url

from . import views


# app_name='request_response'

urlpatterns = [
    # 提取URL路径参数:位置参数
    # url(r'^/weather/beijing/2018/$', views.weather1),
    # 利用正则组来提取url中的路径参数: 位置参数
    # url(r'^weather/([a-z]+)/(\d{4})/$', views.weather1),
    # 利用正则组来提取url中的路径参数: 关键字参数
    url(r"^weather/(?P<city>[a-z]+)/(?P<year>\d{4})/$", views.weather1),

    # 演示获取查询字符串数据
    url(r"^get_query_string/$", views.get_query_string),
    # 演示获取表单数据
    url(r"^get_form/$", views.get_form),
    # 演示获取非表单数据
    url(r"^get_json/$", views.get_json),

    # 演示获取请求头数据
    url(r"^get_request_head/$", views.get_request_head),

    # 演示响应对象的基本操作
    url(r"^response_demo/$", views.response_demo),

    # 演示json响应对象的基本操作
    url(r"^json_response/$", views.json_response),

    # url(r'^路径$', 函数视图, name=给路由起一个别名)
    # 演示重定向
    url(r"^redirect_demo/$", views.redirect_demo, name="index"),


    # 演示cookie读取
    url(r"^cookie_demo/$", views.cookie_demo),

    # 演示session读取
    url(r"^session_demo/$", views.session_demo),



]

